Skip to content

Upgrade Claude Code review to Opus 4.7 with scoped tool permissions#1366

Merged
syed-ahsan-ishtiaque merged 5 commits intomainfrom
upgrade-claude-review-opus-47
Apr 24, 2026
Merged

Upgrade Claude Code review to Opus 4.7 with scoped tool permissions#1366
syed-ahsan-ishtiaque merged 5 commits intomainfrom
upgrade-claude-review-opus-47

Conversation

@syed-ahsan-ishtiaque
Copy link
Copy Markdown
Contributor

Summary

  • Upgrades the Claude Code review model from Opus 4.6 to Opus 4.7
  • Scopes allowedTools patterns to the current PR number instead of wildcards. This prevents Claude from accidentally posting review comments on other PRs (e.g. previously merged PRs).
  • Adds an explicit prompt guardrail telling Claude to only interact with the current PR

Context

On aws-otel-js-instrumentation, a review run for PR #406 accidentally posted 10 review comments on the already-merged PR #391. The cause was the wildcard pattern in allowedTools (repos/*/pulls/*) allowing Claude to post to any PR.

Test plan

  • Verify Claude still posts review comments on new PRs
  • Verify Claude cannot post to other PRs (by checking only current PR gets comments)

@syed-ahsan-ishtiaque syed-ahsan-ishtiaque requested a review from a team as a code owner April 23, 2026 19:44
@syed-ahsan-ishtiaque syed-ahsan-ishtiaque added the skip changelog doesn't need a CHANGELOG entry label Apr 23, 2026
@syed-ahsan-ishtiaque syed-ahsan-ishtiaque enabled auto-merge (squash) April 23, 2026 20:13
liustve
liustve previously approved these changes Apr 23, 2026
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review - PR #1366

Overall Assessment: No bugs or security issues found. Good security improvement.

This PR correctly addresses the issue where wildcard allowedTools patterns allowed Claude to post review comments on unrelated PRs (as happened with aws-otel-js-instrumentation PR #406 posting to #391).

Changes reviewed:

  1. Scoped tool permissions - Replacing wildcard patterns with PR-number-scoped patterns properly restricts the review agent to only interact with the triggering PR. The PR number and repository values are set by GitHub (not user-controlled), so this is safe from injection.

  2. Scoped repository - The API path is similarly restricted to the correct repo.

  3. Prompt guardrail - The explicit instruction to not interact with any other PR adds defense-in-depth.

  4. Model upgrade - Upgrades from Opus 4.6 to Opus 4.7.

LGTM.

wangzlei
wangzlei previously approved these changes Apr 23, 2026
@syed-ahsan-ishtiaque syed-ahsan-ishtiaque merged commit 63cdb5e into main Apr 24, 2026
8 checks passed
@syed-ahsan-ishtiaque syed-ahsan-ishtiaque deleted the upgrade-claude-review-opus-47 branch April 24, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changelog doesn't need a CHANGELOG entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants